export default {
    state: {
        version: '1.0',
        appName: 'vue + iview'
    },
    getters: {
        ["app/_getVersion"](state) {
            return state.version ;
        },
        ["app/_getAppName"](state){
            return state.appName;
        } 
    },
    mutations: {
        ['app/logout'](state, menus) { 
            //退出登陆
        },
        ['app/initUserInfo'](state, userInfo) {
             //初始化用户信息
        },
        ['app/initDocument'](state, userInfo) {
            document.title = state.appName
            console.log('app/initDocument');
        },
        ["app/testStore"](state){
            setInterval(function(){
                state.version = Math.random().toString();
                console.log("---101010改变version");
            } , 1000);
           
        }
    },
    actions: {
        ["app/initApp"]({state, dispatch, commit}) {
            //初始化应用信息
            // commit("app/initDocument")
            console.log("-----");
        },

    }
};
